

    <?php   
    /*function UserAgent(){   
        $user_agent = ( !isset($_SERVER['HTTP_USER_AGENT'])) ? FALSE : $_SERVER['HTTP_USER_AGENT'];   
        return $user_agent;   
    }   
      
    //Mobile   
    if ((preg_match("/(iphone|ipod|android)/i", strtolower(UserAgent()))) AND strstr(strtolower(UserAgent()), 'webkit')){   
        header('Location: m/');   
        exit;   
    }else if(trim(UserAgent()) == '' OR preg_match("/(nokia|sony|ericsson|mot|htc|samsung|sgh|lg|philips|lenovo|ucweb|opera mobi|windows mobile|blackberry)/i", strtolower(UserAgent()))){   
        header('Location: m/');   
        exit;   
    }else{//PC   
        header("Location:index.php");   
    }   */
	
	//echo @$_SERVER['HTTP_X_WAP_PROFILE'];
	
	function is_mobile(){
	// 如果有HTTP_X_WAP_PROFILE则一定是移动设备
  		return isset ($_SERVER['HTTP_X_WAP_PROFILE']) ? true : false;
 
		}

 
 
 
 if(strpos( strtolower($_SERVER['HTTP_USER_AGENT']), 'android' /*HTTP_USER_AGENT中包含android一定是移动设备*/) !== false){
 	$module = 'webapp';
 }

    ?>  

